<?php
//array("pNav"=>"xhtml1","pHead"=>"xhtml2","pDance"=>"xhtml3","pAdd"=>"xhtml4","pJson"=>"xhtml5","pConsole"=>"xhtml6");
class virtualdb extends ControllerAbstract
{
	public function run()
	{
		$page = array();
		$page["pNav"] = $this->pNav();
		$page["pDance"] = $this->pDance();
		$page["pHead"] = '
			<script src="'.($this->js).'/admin/virtualdb.js"></script>
			<link rel="stylesheet" type="text/css" href="'.($this->css).'/admin/virtualdb.css">';
		return $page;
	}
	public function pNav()
	{
		return '
			<a href="'.HOME.'guest.php">首页</a> 
			<a href="javascript:void(0);" id="fileList">文件列表</a> 
			<a href="javascript:void(0);" id="createFile">创建文件</a> 
			<span id="morenav" count="0"></span>
		';
	}
	public function pDance()
	{
		$xhtml = '<div id="listsDan"></div><div id="crtDan">';
		$suffix = array('json','log','accdb','jh','xls','xml','txt','csv','self');//后缀
		$sufUl = '<ul>';
		foreach($suffix as $v){
			$sufUl .= '<li><a href="javascript:void(0);" class="modelSuff" id="'.($v=='self'? '' : $v).'">'.$v.'</a></li>';
		}
		$sufUl .= '</lu>';
		$xhtml .= $sufUl;
		$struct = array('json'=>'JSON','xml'=>'XML','xls'=>'Excel','ser'=>'PHP序列化','csv'=>'scv');
		$form = '<div class="formFile">
			文件名: <input type="text" id="filename"> .<input type="text" id="suffix" readonly="readonly"> 
			<br>数据格式:<select id="struct"></select>
			<br>文件描述:<input type="text" id="fdesc">
			<br><span id="formFileTip"></span>
			<br><button type="button" id="saveFile">生成</button>
		</div>';
		$xhtml .= $form;
		$xhtml .= '</div>';
		return $xhtml;
	}
}